package com.sctvcloud.renhe.ui.adapter.holder;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;

import com.ruihang.generalibrary.ui.widget.CustomFontTextView;
import com.sctvcloud.renhe.R;
import com.sctvcloud.renhe.beans.AFileItem;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/7/12 0012.
 */

public class AnchorIntroHolder extends BaseAnchorHolder<AFileItem> {
    @BindView(R.id.item_anchor_intro_name)
    protected CustomFontTextView name;
    @BindView(R.id.item_anchor_intro_column)
    protected CustomFontTextView column;
    @BindView(R.id.item_anchor_intro_intro)
    protected CustomFontTextView intro;

    public AnchorIntroHolder(Context context, View itemView) {
        super(context, itemView);
    }

    @Override
    protected void initInject() {
        ButterKnife.bind(this, itemView);
    }

    @Override
    public void setData(AFileItem fileItem) {
        if (!TextUtils.isEmpty(fileItem.getAnchorName())) {
            name.setText(fileItem.getAnchorName());
        } else {
            name.setText("");
        }
        if (!TextUtils.isEmpty(fileItem.getCurrentWork())) {
            column.setText(fileItem.getCurrentWork());
        } else {
            column.setText("");
        }
        if (!TextUtils.isEmpty(fileItem.getAnchorIntro())) {
            intro.setText(fileItem.getAnchorIntro());
        } else {
            intro.setText("");
        }
    }
}
